#ifndef EXTERNALAUDIOEQUIPMENT_H 
#define EXTERNALAUDIOEQUIPMENT_H

#include <mutex>
#include <string>
#include <map>
#include <thread>


#ifdef __cplusplus
extern "C" {
#endif

using namespace std;
const string HidInfoCmd = "udevadm info /dev/%s";
class ExternalAudioEquipment{
    public:
        static ExternalAudioEquipment* instance();
        bool openHidraw(string usbport, string devnode);
        bool closeHidraw(string usbport);
        bool senMsgToAudio(char *msg, int len);
        void MonitorAudioThd(string usbport);
        bool sendMsgToPC(char *msg, int len);

    private:
        ExternalAudioEquipment(){}
        ~ExternalAudioEquipment(){}
        static ExternalAudioEquipment *sm_ExternalAudioEquipment;
        static mutex                   sm_instanceLock;
        map<string, int>               m_extrenalAutioMap;
        mutex                          m_sendLock;
};

#ifdef __cplusplus
}
#endif
#endif